<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>文件预览</title>
    <style type="text/css">
    </style>
    <!-- jquery -->
    <script src="/web-container-base/plugins/scripts/jquery.min.js"></script>
    <!-- pdf -->
    <script src="/web-container-base/plugins/pdfjs/build/pdf.js"></script>
    <script src="/web-container-base/plugins/pdfjs/build/pdf.worker.js"></script>
    <!-- bootstrapQ -->
    <link href="/web-container-base/plugins/bootstrapQ/qiao.css" rel="stylesheet">
    <script type="text/javascript" src="/web-container-base/plugins/bootstrapQ/qiao.js"></script>
    <!-- DocSys -->
    <script type="text/javascript" src="/web-container-base/js/common.js"></script>
    <script type="text/javascript" src="/web-container-base/js/base64.js"></script>
    <script type="text/javascript" src="/web-container-base/js/DocSys.js"></script>

    <script type="text/javascript">
        var var_win_height = $(window).height();

        $(document).ready(function () {
            resetPlayerSize();
            viewDoc();
        });

        $(window).resize(function () {
            resetPlayerSize();
        });

        function resetPlayerSize() {
            var_win_height = $(window).height();
            $(".tmPlayer").css({"height": var_win_height + "px"});
        }
    </script>
</head>

<body style="margin: 0;overflow: hidden">
<div id="tmPlayer" class="tmPlayer" style="height: 557px; width: 100%; height: 100%"></div>

<script type="text/javascript">

    function viewDoc() {
        var fileLink = getQueryString("path");
        let uri = '/doc/downloadDoc/' + base64_encode(fileLink);
        uri = buildFullLink(uri);
        showPDF(uri);
    }

    function showPDF(url) {
        console.log("showPDF() url:", url);
        $('.tmPlayer').html('<iframe frameBorder="0" scrolling="no" src="/web-container-base/plugins/pdfjs/web/viewer.html?file=' + url +
            '" style="width:100%; height:100%;"></iframe>');
    }
</script>
</body>
</html>